using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Business.Builders;
using T2.WebSecurity.Business.Directors.Interface;
using T2.WebSecurity.Business.Entities.Search.Interfaces;

//--Change Management Control - ApplicationProfileData Director  --**********************
//--Created By: trooks
//--Description: ApplicationProfileData Director Class
//--Created Date: 03/07/2013 10:49:16
//--*************************************************************

namespace T2.WebSecurity.Business.Directors
{
	public partial class ApplicationProfileData_Director_biz : IApplicationProfileData_director_biz
	{
		
		public List<IApplicationProfileData_biz> Construct (IApplicationProfileData_biz _param, bool BuildUp, bool BuildDown)
		{
			ApplicationProfileData_Builder build = new ApplicationProfileData_Builder();
			List<IApplicationProfileData_biz> retVal = build.BuildParts(_param);
			foreach(IApplicationProfileData_biz item in retVal)
			{
				item.Application = BuildApplication(item, BuildUp, false);
		}
			return retVal;
		}
		public List<IApplicationProfileData_biz> Construct (IApplicationProfileDataSearch_biz _param, bool BuildUp, bool BuildDown)
		{
			ApplicationProfileData_Builder build = new ApplicationProfileData_Builder();
			List<IApplicationProfileData_biz> retVal = build.BuildParts(_param);
			foreach(IApplicationProfileData_biz item in retVal)
			{
				item.Application = BuildApplication(item, BuildUp, false);
		}
			return retVal;
		}
		private IApplication_biz BuildApplication(IApplicationProfileData_biz _param, bool BuildUp, bool BuildDown)
		{
			IApplication_biz retVal = new Application_biz();
			if(BuildUp)
			{
			IApplication_biz ApplicationParam = new Application_biz();
			ApplicationParam.Action = "GetOne";
			ApplicationParam.ApplicationID = _param.ApplicationID;
			Application_Builder builder = new Application_Builder();
			retVal = builder.BuildParts(ApplicationParam).First();
			}
			return retVal;
		}
	}
}